﻿#region File Description
//-----------------------------------------------------------------------------
// PlasmaExplosionParticleSystem.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace ParticleEffects
{
  /// <summary>
  /// Custom particle system for creating the fiery part of the explosions.
  /// </summary>
  public class PlasmaEngineParticleSystem : ParticleSystem
  {
    public PlasmaEngineParticleSystem(Game game, ContentManager content)
      : base(game, content)
    { }


    protected override void InitializeSettings(ParticleSettings settings)
    {
      settings.TextureName = "Explosion/plasma";

      settings.MaxParticles = 2000;

      settings.Duration = TimeSpan.FromSeconds(0.3f);
      settings.DurationRandomness = 1;

      settings.MinHorizontalVelocity = 0.1f;
      settings.MaxHorizontalVelocity = 0.2f;

      settings.MinVerticalVelocity = -0.1f;
      settings.MaxVerticalVelocity = 0.1f;

      settings.EndVelocity = 0;

      settings.MinColor = Color.DarkGray;
      settings.MaxColor = Color.Gray;

      settings.MinRotateSpeed = -1;
      settings.MaxRotateSpeed = 1;

      settings.MinStartSize = 15;
      settings.MaxStartSize = 25;

      settings.MinEndSize = 1;
      settings.MaxEndSize = 3;

      // Use additive blending.
      settings.SourceBlend = Blend.SourceAlpha;
      settings.DestinationBlend = Blend.One;
    }
  }
}
